package util;

import java.sql.*;


/**
 * sqlserver数据库连接
 * @author vsked
 *
 */
public class ConnectDB {
    private static Connection conn = null;
    private static PreparedStatement pt = null;
    private static ResultSet rs = null;
    static Connection objconn=null;
    /**
     * 得到sqlserver数据库连接
     * @return Connection
     * @throws Exception
     */
	public static Connection getSqlServerConnection() throws Exception{
		return Configurations.getInstance().getConnection();
	}
	/**
	 * 关闭数据库连接
	 */
	public static void closeSqlConnection() {
		try {
			if (rs != null) {
				rs.close();
			}
			if (pt != null) {
				pt.close();
			}
			if (conn != null) {
				conn.close();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
	

}
